<template>
    <div>
        <!-- 面包屑导航 -->
    <el-breadcrumb separator-class="el-icon-arrow-right">
      <el-breadcrumb-item :to="{ path: '/goods_manager' }">商品管理</el-breadcrumb-item>
      <el-breadcrumb-item >门店退货</el-breadcrumb-item>
    </el-breadcrumb>
    <el-divider></el-divider>
        <div>
            <el-button type="primary" @click="dialogFormVisible = true">创建门店退货</el-button>
            <el-button type="success" @click="showform">查询</el-button>
            <el-button type="info">导出报表</el-button>
        </div>
        <!-- 创建门店退货 -->
        <div>
          <el-dialog title="新增门店退货单" :visible.sync="dialogFormVisible" width="70%">
                  <el-form :model="form">
                    <el-form-item label="单据编号" >
                      <el-input v-model="form.documentNum" autocomplete="off"></el-input>
                    </el-form-item>
                    <el-row>
                      <el-button type="primary">选择退货商品</el-button>
                      <el-button type="success">批量编码</el-button>
                      <el-button type="info">完成退货</el-button>
                    </el-row>
                    <el-form-item label="创单日期" >
                      <el-input v-model="form.createDate" autocomplete="off"></el-input>
                    </el-form-item>
                      <div class="inputset">
                        <el-form-item class="inputsetdeep" label="商品类型" >
                          <el-select v-model="form.category" placeholder="商品类型">
                            <el-option label="全选" value="allpure"></el-option>
                            <el-option label="素金类" value="puregold"></el-option>
                            <el-option label="镶嵌类" value="mosaicclass"></el-option>
                            <el-option label="其它类" value="otherpure"></el-option>
                          </el-select>
                        </el-form-item>
                        <el-form-item class="inputsetdeep" label="出库门店" >
                          <el-select v-model="form.outboundStore" placeholder="出库门店">
                            <el-option label="1店" value="allpure"></el-option>
                          </el-select>
                        </el-form-item>
                        <el-form-item class="inputsetdeep" label="柜台/类库名称（出）" >
                          <el-select v-model="form.outboundCounter" placeholder="柜台/类库名称">
                            <el-option label="1柜" value="allpure"></el-option>
                          </el-select>
                        </el-form-item>
                        <el-form-item class="inputsetdeep" label="入库门店" >
                          <el-select v-model="form.inboundStore" placeholder="入库门店">
                            <el-option label="2店" value="allpure"></el-option>
                          </el-select>
                        </el-form-item>
                        <el-form-item class="inputsetdeep" label="柜台/类库名称（入）" >
                          <el-select v-model="form.inboundcounter" placeholder="柜台/类库名称">
                            <el-option label="2柜" value="allpure"></el-option>
                          </el-select>
                        </el-form-item>
                      </div>
                  </el-form>
                  <el-table border :data="goodsList">
                    <el-table-column property="goodsId" label="序号" ></el-table-column>
                    <el-table-column property="goodsCode" label="商品编码" ></el-table-column>
                    <el-table-column property="goodsName" label="商品名称"></el-table-column>
                    <el-table-column property="modlNum" label="模具号"></el-table-column>
                    <el-table-column property="commerceNum" label="电商款号"></el-table-column>
                    <el-table-column property="itemNum" label="款号"></el-table-column>
                    <el-table-column property="category1" label="分类1"></el-table-column>
                    <el-table-column property="certificateNum" label="证书号"></el-table-column>
                    <el-table-column property="quality" label="成色"></el-table-column>
                    <el-table-column property="mainStoneHeavy" label="主石重"></el-table-column>
                    <el-table-column property="viceStoneHeavy" label="副石重"></el-table-column>
                    <el-table-column property="goodsNum" label="商品数量"></el-table-column>
                    <el-table-column property="ringSize" label="手寸"></el-table-column>
                    <el-table-column property="costUnitPrice" label="成本单价"></el-table-column>
                    <el-table-column property="salesCosts" label="销售工费"></el-table-column>
                    <el-table-column property="salesSurcharge" label="销售附加费"></el-table-column>
                    <el-table-column label="操作" width='220' align='center'>
                      <template slot-scope="scope">
                          <el-button
                          size="mini"
                          type="warning"
                          @click="Productdetails(scope.$index, scope.row)">商品详情(编辑)</el-button>
                          <el-button
                          size="mini"
                          type="danger"
                          @click="Commodity(scope.$index, scope.row)">删除</el-button>
                      </template>
                    </el-table-column>
                  </el-table>
                  <div>
                    <div class="block">
                        <span class="demonstration">每页显示条数</span>
                        <el-pagination
                        @size-change="handleSizeChange"
                        @current-change="handleCurrentChange"
                        :current-page.sync="currentPage2"
                        :page-sizes="[10, 25, 50, 100]"
                        :page-size="10"
                        layout="sizes, prev, pager, next"
                        :total="100">
                        </el-pagination>
                    </div>
                  </div>
                  <div slot="footer" class="dialog-footer">
                    <el-button @click="dialogFormVisible = false">取 消</el-button>
                    <el-button type="primary" @click="dialogFormVisible = false">确 定</el-button>
                  </div>
                </el-dialog>
        </div>
        <!-- 查询 -->
        <div>
            <div v-show="isshow" class="checkform">
              <div>
                <el-form :inline="true" :model="formInline" class="demo-form-inline">
                  <div class="lpfrom">
                      <el-form-item label="单据编号:">
                        <el-input v-model="formInline.documentstartId" placeholder="请输入内容" class="checknow"></el-input>
                      </el-form-item>
                  </div>
                  <div class="lpfrom">
                      <el-form-item label="创单日期:">
                        <el-input v-model="formInline.startCreatetime" placeholder="请输入内容" class="checknow"></el-input>
                      </el-form-item>
                  </div>
                  <div class="lpfrom">
                    <el-form-item label="商品类型:">
                      <el-select v-model="formInline.splxid" placeholder="商品类型">
                        <el-option label="全部" value=""></el-option>
                      </el-select>
                    </el-form-item>
                  </div>
                  <div class="lpfrom">
                    <el-form-item label="出库门店:">
                      <el-select v-model="formInline.shopid" placeholder="出库门店">
                        <el-option label="1店" value=""></el-option>
                      </el-select>
                    </el-form-item>
                  </div>
                  <div class="lpfrom">
                      <el-form-item label="订单号:">
                        <el-input v-model="formInline.orderid" placeholder="请输入内容" class="checknow"></el-input>
                      </el-form-item>
                  </div>
                  <div class="lpfrom">
                    <el-form-item label="该页条数:">
                      <el-select v-model="formInline.limit" placeholder="请输入内容">
                        <el-option label="2" value="2"></el-option>
                        <el-option label="5" value="5"></el-option>
                        <el-option label="10" value="10"></el-option>
                      </el-select>
                    </el-form-item>
                  </div>
                  <div class="lpfrom">
                    <el-form-item label="页码:">
                      <el-select v-model="formInline.page" placeholder="请输入内容">
                        <el-option label="1" value=""></el-option>
                      </el-select>
                    </el-form-item>
                  </div>
                  <div class="lpfrom">
                      <el-form-item label="创单人:">
                        <el-input v-model="formInline.createperson" placeholder="请输入内容" class="checknow"></el-input>
                      </el-form-item>
                  </div>
                  <div class="lpfrom">
                    <el-form-item label="供应商表的id:">
                        <el-input v-model="formInline.supplierid" placeholder="请输入内容" class="checknow"></el-input>
                      </el-form-item>
                  </div>
                  <div class="lpfrom">
                    <el-button type="success" @click="confirmquery">确认查询</el-button>
                    <el-button type="warning" @click="stowinput">收起</el-button>
                  </div>
                </el-form>
              </div>
              <div>
                <el-table border :data="returnsListOrders">
                  <el-table-column property="id" label="序号" ></el-table-column>
                  <el-table-column property="state" label="状态" ></el-table-column>
                  <el-table-column property="documentid" label="单据编号"></el-table-column>
                  <el-table-column property="createtime" label="创单时间"></el-table-column>
                  <el-table-column property="fendianname" label="出库门店"></el-table-column>
                  <el-table-column property="guitainame" label="出库柜台"></el-table-column>
                  <el-table-column property="inboundStore" label="入库门店"></el-table-column>
                  <el-table-column property="inboundcounter" label="入库柜台"></el-table-column>
                  <el-table-column property="typeName" label="商品类型"></el-table-column>
                  <el-table-column property="number" label="数量"></el-table-column>
                  <el-table-column property="weight" label="总重量"></el-table-column>
                  <el-table-column property="cost" label="总成本"></el-table-column>
                  <el-table-column property="coefficient" label="系列"></el-table-column>
                  <el-table-column property="labelamount" label="标签总价"></el-table-column>
                  <el-table-column property="createperson" label="创单人"></el-table-column>
                  <el-table-column property="approver" label="审批人"></el-table-column>
                  <el-table-column property="approverdate" label="审批日期"></el-table-column>
                <el-table-column label="操作" width='280' align='center'>
                  <template slot-scope="scope">
                      <el-button
                        size="mini"
                        type="primary"    
                        @click="toexamine(scope.$index, scope.row)">审核</el-button>
                      <el-button
                      size="mini"
                      type="warning"
                      @click="Productdetails(scope.$index, scope.row)">商品详情(编辑)</el-button>
                      <el-button
                      size="mini"
                      type="danger"
                      @click="Commodity(scope.$index, scope.row)">删除</el-button>
                  </template>
                </el-table-column>
              </el-table>
              </div>
                  <div class="block">
                    <span class="demonstration">每页显示条数</span>
                    <el-pagination
                    @size-change="handleSizeChange"
                    @current-change="handleCurrentChange"
                    :current-page.sync="currentPage2"
                    :page-sizes="[10, 25, 50, 100]"
                    :page-size="10"
                    layout="sizes, prev, pager, next"
                    :total="100">
                    </el-pagination>
                </div>
            </div>
            <!-- 退货界面 -->
          <div v-show="showis">
            <el-table
                :data="returnsListOrders"
                border
                style="width: 100%">
                <el-table-column
                prop="id"
                align='center'
                label="行号">
                </el-table-column>
                <el-table-column
                prop="state"
                align='center'
                label="状态">
                <template slot-scope="scope">
                  <span>{{scope.row == 0 ? "已驳回": scope.row == 1 ? '已通过': '待审核'}}</span>
                </template>
                </el-table-column>
                <el-table-column
                prop="documentid"
                align='center'
                label="单据编号">
                </el-table-column>
                <el-table-column
                prop="createtime"
                align='center'
                label="创单时间">
                </el-table-column>
                <el-table-column
                prop="fendianname"
                align='center'
                label="出库门店">
                </el-table-column>
                <el-table-column
                prop="guitainame"
                align='center'
                label="出库柜台">
                </el-table-column>
                <el-table-column
                prop="from"
                align='center'
                label="入库门店">
                </el-table-column>
                <el-table-column
                prop="counterid"
                align='center'
                label="入库柜台">
                </el-table-column>
                <el-table-column
                prop="typeName"
                align='center'
                label="商品类型">
                </el-table-column>
                <el-table-column
                prop="number"
                align='center'
                label="数量">
                </el-table-column>
                <el-table-column
                prop="weight"
                align='center'
                label="总重量">
                </el-table-column>
                <el-table-column
                prop="cost"
                align='center'
                label="总成本">
                </el-table-column>
                <el-table-column
                prop="coefficient"
                align='center'
                label="系列">
                </el-table-column>
                <el-table-column
                prop="labelamount"
                align='center'
                label="标签总价">
                </el-table-column>
                <el-table-column
                prop="createperson"
                align='center'
                label="创单人">
                </el-table-column>
                <el-table-column
                prop="approver"
                align='center'
                label="审批人">
                </el-table-column>
                <el-table-column
                prop="approverdate"
                align='center'
                label="审批日期">
                </el-table-column>
                <el-table-column label="操作" width='280' align='center'>
                    <template slot-scope="scope">
                        <el-button
                        size="mini"
                        type="primary"
                        :disabled='scope.row.disable'
                        @click="toexamine(scope.$index, scope.row)">{{scope.row.toexaminesuccess}}</el-button>
                        <el-button
                        size="mini"
                        type="warning"
                        @click="formviisble1(scope.$index, scope.row)">查看(编辑)</el-button>
                        <el-button
                        size="mini"
                        type="danger"
                        @click="flashout(scope.$index, scope.row)">删除</el-button>
                    </template>
                </el-table-column>
            </el-table>
              <div>
                <div class="block">
                    <span class="demonstration">每页显示条数</span>
                    <el-pagination
                    @size-change="handleSizeChange"
                    @current-change="handleCurrentChange"
                    :current-page.sync="currentPage"
                    :page-sizes="[1, 2, 5, 10]"
                    :page-size="limit"
                    layout="sizes, prev, pager, next"
                    :total="total">
                    </el-pagination>
                </div>
              </div>
            </div>
        </div>
        <!-- 查看编辑 -->
        <div>
          <el-dialog title="查看编辑" :visible.sync="FormVisible" class="checkformh">
            <el-form :inline="true" :model="formcheck" class="demo-form-inline">
              <el-form-item label="Id" class="lp_checkformin">
                <el-input v-model="formcheck.goodsId" autocomplete="off"></el-input>
              </el-form-item>
              <el-form-item label="状态" class="lp_checkformin">
                <el-input v-model="formcheck.status" autocomplete="off"></el-input>
              </el-form-item>
              <el-form-item label="单据编号" class="lp_checkformin">
                <el-input v-model="formcheck.documentNum" autocomplete="off"></el-input>
              </el-form-item>
              <el-form-item label="创单时间" class="lp_checkformin">
                <el-input v-model="formcheck.createDate" autocomplete="off"></el-input>
              </el-form-item>
              <el-form-item label="出库门店" class="lp_checkformin">
                <el-select v-model="formcheck.outboundStore" placeholder="出库门店">
                  <el-option label="1店" value="allpure"></el-option>
                  <el-option label="2店" value="two"></el-option>
                </el-select>
              </el-form-item>
              <el-form-item label="出库柜台" class="lp_checkformin">
                <el-select v-model="formcheck.outboundCounter" placeholder="出库柜台">
                  <el-option label="1柜" value="allpure"></el-option>
                  <el-option label="2柜" value="two"></el-option>
                </el-select>
              </el-form-item>
              <el-form-item label="入库门店" class="lp_checkformin">
                <el-select v-model="formcheck.inboundStore" placeholder="入库门店">
                  <el-option label="1店" value="allpure"></el-option>
                  <el-option label="2店" value="two"></el-option>
                </el-select>
              </el-form-item>
              <el-form-item label="入库柜台" class="lp_checkformin">
                <el-select v-model="formcheck.inboundcounter" placeholder="入库柜台">
                  <el-option label="1柜" value="allpure"></el-option>
                  <el-option label="2柜" value="two"></el-option>
                </el-select>
              </el-form-item>
              <el-form-item label="商品类型" class="lp_checkformin">
                <el-select v-model="formcheck.category" placeholder="入库柜台">
                  <el-option label="高级" value="allpure"></el-option>
                  <el-option label="2" value="two"></el-option>
                </el-select>
              </el-form-item>
              <el-form-item label="数量" class="lp_checkformin">
                <el-input v-model="formcheck.count" autocomplete="off"></el-input>
              </el-form-item>
              <el-form-item label="总重量" class="lp_checkformin">
                <el-input v-model="formcheck.totalWeight" autocomplete="off"></el-input>
              </el-form-item>
              <el-form-item label="总成本" class="lp_checkformin">
                <el-input v-model="formcheck.totalPrice" autocomplete="off"></el-input>
              </el-form-item>
              <el-form-item label="总重量" class="lp_checkformin">
                <el-input v-model="formcheck.totalWeight" autocomplete="off"></el-input>
              </el-form-item>
              <el-form-item label="系列" class="lp_checkformin">
                <el-select v-model="formcheck.series" placeholder="入库柜台">
                  <el-option label="精品" value="allpure"></el-option>
                  <el-option label="2" value="two"></el-option>
                </el-select>
              </el-form-item>
              <el-form-item label="标签总价" class="lp_checkformin">
                <el-input v-model="formcheck.LabelTotalPrice" autocomplete="off"></el-input>
              </el-form-item>
              <el-form-item label="创单人" class="lp_checkformin">
                <el-input v-model="formcheck.createPerson" autocomplete="off"></el-input>
              </el-form-item>
              <el-form-item label="审批人" class="lp_checkformin">
                <el-input v-model="formcheck.approver" autocomplete="off"></el-input>
              </el-form-item>
              <el-form-item label="审批日期" class="lp_checkformin">
                <el-input v-model="formcheck.approvalDate" autocomplete="off"></el-input>
              </el-form-item>
            </el-form>
            <div slot="footer" class="dialog-footer" >
              <el-button @click="cancelformchange">取 消</el-button>
              <el-button type="primary" @click="FormVisible = false">确定并保存</el-button>
            </div>
          </el-dialog>
        </div>
        <!-- 审核 -->
        <div>
          <el-dialog title="门店退货单审核" :visible.sync="toexamineFormVisible">
            <div>
              <el-form :inline="true" :model="returnapproval" class="demo-form-inline">
                  <el-form-item label="商品类型:">
                    <el-select v-model="returnapproval.category" placeholder="商品类型">
                      <el-option label="素金类" value="Puregold"></el-option>
                      <el-option label="镶嵌类" value="Mosaicclass"></el-option>
                      <el-option label="玉石类" value="Jade"></el-option>
                    </el-select>
                  </el-form-item>
                  <el-form-item label="商品名称:">
                    <el-input v-model="returnapproval.goodsName" autocomplete="off"></el-input>
                  </el-form-item>
                  <el-form-item label="模具号:">
                    <el-input v-model="returnapproval.modlNum" autocomplete="off"></el-input>
                  </el-form-item>
                  <el-form-item label="创单时间:">
                    <el-input v-model="returnapproval.createDate" autocomplete="off"></el-input>
                  </el-form-item>
                  <el-form-item label="订单号:">
                    <el-input v-model="returnapproval.documentNum" autocomplete="off"></el-input>
                  </el-form-item>
                  <el-form-item label="证书号:">
                    <el-input v-model="returnapproval.certificateNum" autocomplete="off"></el-input>
                  </el-form-item>
                  <el-form-item label="单件重:">
                    <el-input v-model="returnapproval.totalHeavy" autocomplete="off"></el-input>
                  </el-form-item>
                  <el-form-item label="单据编号:">
                    <el-input v-model="returnapproval.documentNum" autocomplete="off"></el-input>
                  </el-form-item>
              </el-form>
            </div>
            <div>
              <el-table border :data="returnlist">
                  <el-table-column property="goodsId" label="序号" ></el-table-column>
                  <el-table-column property="goodsCode" label="商品编码" ></el-table-column>
                  <el-table-column property="goodsName" label="商品名称"></el-table-column>
                  <el-table-column property="modlNum" label="模具号"></el-table-column>
                  <el-table-column property="commerceNum" label="电商款号"></el-table-column>
                  <el-table-column property="itemNum" label="款号"></el-table-column>
                  <el-table-column property="category1" label="分类1"></el-table-column>
                  <el-table-column property="certificateNum" label="证书号"></el-table-column>
                  <el-table-column property="quality" label="成色"></el-table-column>
                  <el-table-column property="mainStoneHeavy" label="主石重"></el-table-column>
                  <el-table-column property="viceStoneHeavy" label="副石重"></el-table-column>
                  <el-table-column property="goodsNum" label="商品数量"></el-table-column>
                  <el-table-column property="ringSize" label="手寸"></el-table-column>
                  <el-table-column property="costUnitPrice" label="成本单价"></el-table-column>
                  <el-table-column property="salesCosts" label="销售工费"></el-table-column>
                  <el-table-column property="salesSurcharge" label="销售附加费"></el-table-column>
                <el-table-column label="操作" width='220' align='center'>
                  <template slot-scope="scope">
                      <el-button
                      size="mini"
                      type="warning"
                      @click="Productdetails(scope.$index, scope.row)">商品详情(编辑)</el-button>
                      <el-button
                      size="mini"
                      type="danger"
                      @click="Commodity(scope.$index, scope.row)">删除</el-button>
                  </template>
                </el-table-column>
              </el-table>
            </div>
          <div>
            <div class="block">
                <span class="demonstration">每页显示条数</span>
                <el-pagination
                @size-change="handleSizeChange"
                @current-change="handleCurrentChange"
                :current-page.sync="currentPage2"
                :page-sizes="[10, 25, 50, 100]"
                :page-size="10"
                layout="sizes, prev, pager, next"
                :total="100">
                </el-pagination>
            </div>
        </div>
            <div slot="footer" class="dialog-footer">
              <el-button @click="toexamineFormVisible = false">审批通过</el-button>
              <el-button type="primary" @click="toexamineFormVisible = false">审批驳回</el-button>
            </div>
          </el-dialog>
      </div>
    </div>
</template>

<style lang="scss" scoped>

.inputset .inputsetdeep {
  float: left;
  margin-right: 30px;
}
.modalbox {
  width: 100%;
}
.checkform {
  margin-top: 20px;
}
.checkform .checknow {
  width: 200px;
}
.lpfrom{
  float: left;
}
.lp_checkformin {
  margin-right: 20px;
  width: 200px;
}
</style>


<script>
import { returngood,returngoodall,deleteCai,selectByChoose } from "@/http/returngoods";
export default {
    name:'ReturnGoods',
    data(){
        return {
              limit:5,
              currentPage:1,
              total:100,
              FormVisible1:false,
              toexamineFormVisible:false,
              isshow:false,
              showis:true,
              disable:false,
              // newform:false,
              currentPage1: 5,
              currentPage2: 1,
              currentPage3: 5,
              currentPage4: 4,
              dialogTableVisible: false,
              dialogFormVisible: false,
              FormVisible: false,
              // formLabelWidth: '120px',
            form: {
              documentNum:'',
              createDate: '',
              category: '',
              outboundStore: '',
              outboundCounter: '',
              inboundStore: '',
              inboundcounter: '',
            },
            returnapproval:{
              category: '高级', // 商品类型
              goodsName: '戒指', // 商品名称
              modlNum: '201', // 模具号
              createDate: '2016-05-02',//创单时间
              documentNum: '10150015412',//单据编号
              certificateNum: '3052518', // 证书号
              totalHeavy: '30', // 总重
              
            },
            checklist:[
              {
              // goodsId: '1',//Id
              // status: '0',//状态（0：已驳回；1：已通过；2：待审核）
              // documentNum: '10150015412',//单据编号
              // createDate: '2016-05-02',//创单时间
              // outboundStore: '1店',//出库门店
              // outboundCounter: '2号柜台',//出库柜台
              // inboundStore: '2店',//入库门店
              // inboundcounter: '4号柜台',//入库柜台
              // category: '高级', // 商品类型
              // count: '20', // 数量
              // totalWeight: '10', // 总重量
              // totalPrice: '5000', // 总成本
              // series: '精品', // 系列
              // LabelTotalPrice: '300', // 标签总价
              // createPerson: '王平', // 创单人
              // approver: '自己', // 审批人
              // approvalDate: '2016-05-04', // 审批日期
              },
              {

              }
            ],
              returnlist: [{
              goodsId: '1',
              goodsCode: '10021', // 商品编码
              goodsName: '戒指', // 商品名称
              modlNum: '201', // 模具号
              commerceNum: '96654', // 电商款号
              itemNum: '60', // 款号
              category1: '一类', // 分类1
              certificateNum: '3052518', // 证书号
              quality: '2级', // 成色
              mainStoneHeavy: '20', // 主石重
              viceStoneHeavy: '10', // 副石重
              goodsNum: '60', // 商品数量
              ringSize: '3', // 手寸
              costUnitPrice: '300', // 成本单价
              salesCosts: '6000', // 销售工费
              salesSurcharge: '633', // 销售附加费
              series: '精品', // 系列
              brand: '雕牌', // 品牌
              priceType: '奢侈', // 价格类型
              bidPrice: '10', // 标签单价
              LabelTotalPrice: '123', // 标签总价
              }, {
                
              }, {
                
              }, {
                
              }],
            formcheck:{
              // goodsId: '1',//Id
              // status: '0',//状态（0：已驳回；1：已通过；2：待审核）
              // documentNum: '10150015412',//单据编号
              // createDate: '2016-05-02',//创单时间
              // outboundStore: '1店',//出库门店
              // outboundCounter: '2号柜台',//出库柜台
              // inboundStore: '2店',//入库门店
              // inboundcounter: '4号柜台',//入库柜台
              // category: '高级', // 商品类型
              // count: '20', // 数量
              // totalWeight: '10', // 总重量
              // totalPrice: '5000', // 总成本
              // series: '精品', // 系列
              // LabelTotalPrice: '300', // 标签总价
              // createPerson: '王平', // 创单人
              // approver: '自己', // 审批人
              // approvalDate: '2016-05-04', // 审批日期              
            },
            formInline: {
              createperson:'',//创单人
              documentStartId:'',//单据编号
              limit:'',//该页条数
              orderid:'',//订单号
              page:'',//页码
              shopid: '',//门店id
              splxid:'',//商品类型id
              startCreatetime:'',//创单结束时间
              supplierid:''//供应商表的id
            },
              goodsList: [{
              goodsId: '1',
              goodsCode: '10021', // 商品编码
              goodsName: '戒指', // 商品名称
              modlNum: '201', // 模具号
              commerceNum: '96654', // 电商款号
              itemNum: '60', // 款号
              category1: '一类', // 分类1
              certificateNum: '3052518', // 证书号
              quality: '2级', // 成色
              mainStoneHeavy: '20', // 主石重
              viceStoneHeavy: '10', // 副石重
              goodsNum: '60', // 商品数量
              ringSize: '3', // 手寸
              costUnitPrice: '300', // 成本单价
              salesCosts: '6000', // 销售工费
              salesSurcharge: '633', // 销售附加费
              series: '精品', // 系列
              brand: '雕牌', // 品牌
              priceType: '奢侈', // 价格类型
              bidPrice: '10', // 标签单价
              LabelTotalPrice: '123', // 标签总价
          },
          {
            goodsId: '1',
            goodsCode: '10021', // 商品编码
            goodsName: '戒指', // 商品名称
            modlNum: '201', // 模具号
            commerceNum: '96654', // 电商款号
            itemNum: '60', // 款号
            category1: '一类', // 分类1
            certificateNum: '3052518', // 证书号
            quality: '2级', // 成色
            mainStoneHeavy: '20', // 主石重
            viceStoneHeavy: '10', // 副石重
            goodsNum: '60', // 商品数量
            ringSize: '3', // 手寸
            costUnitPrice: '300', // 成本单价
            salesCosts: '6000', // 销售工费
            salesSurcharge: '633', // 销售附加费
            series: '精品', // 系列
            brand: '雕牌', // 品牌
            priceType: '奢侈', // 价格类型
            bidPrice: '10', // 标签单价
            LabelTotalPrice: '123', // 标签总价
          }, 
          {
           
          }, 
          {
            
          }],
        returnsListOrders: [
            {
              goodsId: '1',//Id
              status: '0',//状态（0：已驳回；1：已通过；2：待审核）
              documentNum: '10150015412',//单据编号
              createDate: '2016-05-02',//创单时间
              outboundStore: '1店',//出库门店
              outboundCounter: '2号柜台',//出库柜台
              inboundStore: '2店',//入库门店
              inboundcounter: '4号柜台',//入库柜台
              category: '高级', // 商品类型
              count: '20', // 数量
              totalWeight: '10', // 总重量
              totalPrice: '5000', // 总成本
              series: '精品', // 系列
              LabelTotalPrice: '300', // 标签总价
              createPerson: '王平', // 创单人
              approver: '自己', // 审批人
              approvalDate: '2016-05-04', // 审批日期
        },
         {
            goodsId: '2',//Id
            status: '2',//状态（0：已驳回；1：已通过；2：待审核）
            documentNum: '10150015412',//单据编号
            createDate: '2016-05-02',//创单时间
            outboundStore: '1店',//出库门店
            outboundCounter: '2号柜台',//出库柜台
            inboundStore: '2店',//入库门店
            inboundcounter: '4号柜台',//入库柜台
            category: '高级', // 商品类型
            count: '20', // 数量
            totalWeight: '10', // 总重量
            totalPrice: '5000', // 总成本
            series: '精品', // 系列
            LabelTotalPrice: '300', // 标签总价
            createPerson: '王平', // 创单人
            approver: '自己', // 审批人
            approvalDate: '2016-05-04', // 审批日期
        }, 
        {
            status: '1',//状态（0：已驳回；1：已通过；2：待审核）
        }, 
        {
           status: '2',//状态（0：已驳回；1：已通过；2：待审核） 
        }
        ],
        addreturnsListOrders: []
      }
    },
    created(){
      this.returnsListOrders.forEach((item)=>{
        if(item.status == '0'){
          item.status ='已驳回'
          item.toexaminesuccess ='撤销驳回'
        }else if(item.status == '1'){
          item.status ='已通过'
          item.disable=true
          item.toexaminesuccess ='已通过'
        }else if(item.status == '2'){
          item.status='待审核'
          item.toexaminesuccess='审核'
        }
      })
      this.getinit()
    },
    watch:{
      
    },
    methods: {
      toexamine(index, row) {
        console.log(index, row);
        let newform=this.returnsListOrders.filter((item)=>{
          return item.goodsId=row.goodsId
        })
        if (newform[0].status== '已驳回') {
          row.status='待审核'
          row.toexaminesuccess='审核'
        }else if(newform[0].status=='待审核'){
          this.toexamineFormVisible=true
        }
      },
      getinit(){
        returngood(this.limit,this.currentPage)
        .then((res)=>{
          console.log('获取分页成功',res.data.该页总条数);
          this.total=res.data.该页总条数
          this.returnsListOrders=res.data.data
        })
        .catch((err)=>{
          console.log('获取分页失败',err);
        })
        returngoodall()
        .then((res)=>{
          console.log('获取数据列表成功',res.data);
          this.returnsListOrders=res.data.data
        })
        .catch((err)=>{
          console.log('获取数据列表失败',err);
        })
      },
      handleCurrentChange(val) {
        this.currentPage = val
        this.getinit()
      },
      viewedit(index, row) {
        console.log(index, row);
      },
      formviisble1(index,row){
        console.log(index,row);
        this.FormVisible=true
        // console.log(this.formcheck);
        this.formcheck=row
        let copy = Object.assign({},this.formcheck)
        console.log(copy);
        this.addreturnsListOrders = copy  
        console.log(this.addreturnsListOrders);
        // localStorage.setItem('obj',JSON.stringify(this.row))
        // let obj=this.returnsListOrders.filter((item)=>{
        //   return item.goodsId==row.goodsId
        // })
        // console.log(obj);
      },
      cancelformchange(){
        this.FormVisible = false
        // let  obj=[]
        // console.log(obj);
        // obj.push(this.addreturnsListOrders)
        this.formcheck = this.addreturnsListOrders
        // console.log(obj);
        
      },
      flashout(index,row) {
         console.log(index, row);
         this.$confirm('此操作将永久删除该条信息, 是否继续?', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          deleteCai(row.id)
          .then((res)=>{
            console.log('删除成功',res.data);
            this.getinit()
          })
          .catch((err)=>{
            console.log('删除失败',err);
          })
          
        }).catch(() => {
               this.$message({
            type: 'info',
            message: '已取消删除'
          });  
        });
      },
      Productdetails(index, row) {
        console.log(index, row);
      },
      Commodity(index, row) {
        console.log(index, row);
      },
      handleSizeChange(val) {
        this.limit = val
        this.getinit()
      },
      showform(){
        this.isshow=true
        this.showis=false
      },
      stowinput(){
        this.isshow=false
        this.showis=true
      },
      //模糊查询
      confirmquery(){
        selectByChoose(this.limit,this.currentPage,this.documentStartId)
        .then((res)=>{
          console.log('查询成功',res.data);
        })
        .catch((err)=>{
          console.log('查询失败',err);
        })
      }
    }
}
</script>